package testing;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import commands.Complete;

import storage.Task;
import storage.TaskMemoryController;
import storage.TaskStatus;

public class CompleteTestJUnit {
	
	Task taskDummy;
	Complete testObject;

	@Before
	public void setUp() throws Exception {
		testObject = new Complete();
		TaskMemoryController.init();
		taskDummy = TaskMemoryController.getTasks().get(0);
		taskDummy.setStatus(TaskStatus.INCOMPLETE);
		TaskMemoryController.setTask(taskDummy, taskDummy.getId());
	}

	@After
	public void tearDown() throws Exception {
		
	}

	@Test
	public void testCompleteTask() {
		testObject.completeTask(taskDummy.getId());
		assertEquals(TaskStatus.COMPLETE, TaskMemoryController.getTaskById(taskDummy.getId()).getStatus());
	}

}
